# -*-coding: utf-8 -*-
#锟斤拷锟斤拷舜锟斤拷锟�
from twisted.internet import reactor, protocol
from NetMsgLib import UniversaService

dict = {
"/PresS/Subscribe" :
'''HYCP/1.0 200 OK\r
Content-Length:2634\r
Server:PresS\r    
\r
<StatusList><Terminal Account="drtext12@wan.picc" Online="false"></Terminal>
<Terminal Account="admin1@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext15@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext1@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext14@wan.picc" Online="false"></Terminal>
<Terminal Account="QQ@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext22@wan.picc" Online="false"></Terminal>
<Terminal Account="mm8@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext3@wan.picc" Online="false"></Terminal>
<Terminal Account="lijuan@wan.picc" Online="false"></Terminal>
<Terminal Account="wxj@wan.picc" Online="true"></Terminal>
<Terminal Account="drtext23@wan.picc" Online="false"></Terminal>
<Terminal Account="qq@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext13@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext25@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext9@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext30@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext24@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext27@wan.picc" Online="false"></Terminal>
<Terminal Account="lj@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext28@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext18@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext4@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext26@wan.picc" Online="false"></Terminal>
<Terminal Account="cuadmin@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext16@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext20@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext7@wan.picc" Online="false"></Terminal>
<Terminal Account="admin2@wan.picc" Online="false"></Terminal>
<Terminal Account="fangys@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext17@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext8@wan.picc" Online="false"></Terminal>
<Terminal Account="heng@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext5@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext10@wan.picc" Online="false"></Terminal>
<Terminal Account="zjm@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext2@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext6@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext21@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext29@wan.picc" Online="false"></Terminal>
<Terminal Account="drtext19@wan.picc" Online="false"></Terminal>
</StatusList>''' 
}
	
class NMAFactory(protocol.Factory):
	protocol=UniversaService;
	dict = dict
class NMA:
	def __init__(self, port):
		print "NMA started at port %d"%port
		reactor.listenTCP(port,NMAFactory())

nma = NMA(3002)
reactor.run()
